<template>
	<view class="container">
		<view class="content">
			<view class="top">
				<view class="left">
					<view class="photo">
						<image :src="persionalList.imageUrl=='' || persionalList.imageUrl==null?'../../static/wodi.png':persionalList.imageUrl" mode="aspectFill"></image>
					</view>
					<view class="merbinfo">
						<view>
							<p class="title">姓名</p>
							<p class="cont1">{{persionalList.realName=='' || persionalList.realName==null?'------':persionalList.realName}}</p>
						</view>
						<view>
							<p class="title">辅导教师</p>
							<p class="cont1">{{persionalList.leaderTeacher=='' || persionalList.leaderTeacher==null?'------':persionalList.leaderTeacher}}</p>
						</view>
					</view>
				</view>
				<view class="right">
					<image :src="arrLength == 0?'':'../../static/xiaozhengshu.jpg'" mode="aspectFill"></image>
				</view>
				<view class="bottom">
					<view>
						<p class="title">学校</p>
						<p class="cont1">{{persionalList.school=='' || persionalList.school==null?'------':persionalList.school}}</p>
					</view>
					<view>
						<p class="title">年级</p>
						<p class="cont1">{{persionalList.grade=='' || persionalList.grade==null?'------':persionalList.grade}}</p>
					</view>
				</view>
			</view>
			<view style="margin-top: 15rpx;">
				<h3 >获奖信息</h3>
			</view>
			<view class="list" v-for="item in certificateList" :key="item.userId">
				<view class="l">
					<image src="../../static/huojiang.png" mode=""></image>
				</view>
				<view class="r">
					<view class="com">{{item.competitionName=='' || item.competitionName==null?'---':item.competitionName}}</view>
					<p></p>
					<p><text>{{item.projectName=='' || item.projectName==null?'---':item.projectName}}</text> &nbsp;&nbsp;<text>{{item.groupLeve=='' || item.groupLeve==null?'---':item.groupLeve}}组</text></p>
					<p>{{item.awardsLeave=='' || item.awardsLeave==null?'---':item.awardsLeave}}等奖</p>
					<p>辅导老师：<text>{{persionalList.leaderTeacher=='' || persionalList.leaderTeacher==null?'---':persionalList.leaderTeacher}}</text></p>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {nationCompetition} from '../../apis'
	export default{
		data() {
			return{
				certificateList:[],
				persionalList:{},
				arrLength:0
			}
		},
		onLoad(option) {
			console.log("数组长度"+this.certificateList.length)
			console.log('进入加载页面')
			console.log(option)
			this.persionalList = JSON.parse(decodeURIComponent(option.persionalInfo))
			nationCompetition().then((res)=>{
				let [err,data] = res
				console.log("获奖记录为："+JSON.stringify(data))
				if(err!=null){
					console.log(err)
				}
				console.log("获奖记录为："+data.data.data)
				this.certificateList = data.data.data
				console.log("数组长度"+this.certificateList.length)
				this.arrLength = this.certificateList.length
			})
		},
		methods:{
			
		}
	}
</script>

<style lang="scss" scoped>
	.content{
		padding-top: 5px;
		h3{
			height: 20px;
			height: 30px;
			line-height: 30px;
			font-size: 14px;
			color: #9a9999;
			font-weight: 900;
			padding-left: 10px;
			background-color: #eee;
			
		}
		.top{
			position: relative;
			// margin-top: 15rpx;
			// padding-left: 30px;
			.title{
				font-size: 12px;
				color: #737272;
			}
			.cont1{
				font-size: 14px;
				color: #000000;
				
			}
			.left{
				width: 100%;
				height:100%;
				// border: 1px solid #ccc;
				.photo{
					padding-left: 0px;
					width: 35%;
					height: 140px;
					border: 2px solid #fff;
					padding-top: 18px;
					padding-left: 25px;
				}
				.merbinfo{
					padding-top: 10px;
					line-height: 20px;
					padding-left: 60px;

				}
			}
			.right{
				width: 50%;
				height: 250px;
				position: absolute;
				top: 8px;
				right: 0;
				margin-right: 15rpx;

			}
			.bottom{
				display: flex;
				padding-left: 60px;
				view{
					flex: 2;
				}
			}
		}
		.list{
			border-bottom: 2px solid #cdcccc;
			width: 100%;
			height: 150px;
			position: relative;
			margin-bottom: 10px;
			.l{
				width: 25%;
				height: 55%;
				// border: 1px solid yellow;
				position: absolute;
				top: 20%;
				left: 15%;
				image{
					width: 100%;
					height: 100%;
				};
			}
			.r{
				width: 50%;
				height: 80%;
				position: absolute;
				right: 10%;
				top: 15%;
				// border: 1px solid #ccc;
				text-align: center;
				overflow: hidden;
			}
			
			
		}
	}
	.com{
		text-overflow: ellipsis;
		display: inline;
	}
</style>
